<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./css/reset.css">
  <!-- 
    1. 先完成结构
    2. 重置样式(body/a/ul)
    3. 先整体, 后局部
      * 顺序: 按照从外往里. 从上往下
    4. 去除重复的代码(css)
      * 将重复的逻辑放到一个单独的class中(.icon)
      * 不同的代码抽到不同的class(.new .hot)
   -->
  <style>
    ul > li {
      margin-top: 18px;
    }

    ul > li > a {
      display: inline-block;
    }

    ul > li > a:hover {
      color: #f04142;
    }

    /* 局部 */
    ul > li .ranking {
      display: inline-block;
      width: 24px;
      height: 24px;
      margin-right: 3px;
      text-align: center;
      line-height: 24px;

      font-weight: 700;
      color: #999;
    }

    /* 伪类: 结构伪类(后续会详细讲解) */

    ul > li:nth-child(1) .ranking {
      color: #f00;
    }
    
    ul > li:nth-child(2) .ranking {
      color: #0f0;
    }
    
    ul > li:nth-child(3) .ranking {
      color: #00f;
    }


    /* 内容相关 */
    ul > li .content {
      display: inline;
    }

    /* 图标相关的 */
    ul > li .icon {
      position: relative;
      top: 2px;
      left: 4px;

      display: inline-block;
      width: 16px;
      height: 16px;
      background-image: url(../images/new_icon.svg);
    }

    ul > li .new {
      background-image: url(../images/new_icon.svg);
    }

    ul > li .hot {
      background-image: url(../images/hot_icon.svg);
    }

  </style>
</head>
<body>
  
  <ul>
    <li class="item">
      <a href="#">
        <span class="ranking">1</span>
        <div class="content">
          一花一世界明媚春天杜鹃花开满枝头色彩艳丽繁花似锦
        </div>
        <i class="icon"></i>
      </a>
    </li>
    <li class="item">
      <a href="#">
        <span class="ranking">2</span>
        <div class="content">
          一花一世界明媚春天杜鹃花开满枝头色彩艳丽繁花似锦
        </div>
        <i class="icon new"></i>
      </a>
    </li>
    <li class="item">
      <a href="#">
        <span class="ranking">3</span>
        <div class="content">
          一花一世界明媚春天杜鹃花开满枝头色彩艳丽繁花似锦
        </div>
      </a>
    </li>
    <li class="item">
      <a href="#">
        <span class="ranking">4</span>
        <div class="content">
          一花一世界明媚春天杜鹃花开满枝头色彩艳丽繁花似锦
        </div>
        <i class="icon"></i>
      </a>
    </li>
    <li class="item">
      <a href="#">
        <span class="ranking">5</span>
        <div class="content">
          一花一世界明媚春天杜鹃花开满枝头色彩艳丽繁花似锦
        </div>
        <i class="icon hot"></i>
      </a>
    </li>
    <li class="item">
      <a href="#">
        <span class="ranking">6</span>
        <div class="content">
          一花一世界明媚春天杜鹃花开满枝头色彩艳丽繁花似锦
        </div>
      </a>
    </li>
    <li class="item">
      <a href="#">
        <span class="ranking">7</span>
        <div class="content">
          一花一世界明媚春天杜鹃花开满枝头色彩艳丽繁花似锦
        </div>
        <i class="icon"></i>
      </a>
    </li>
    <li class="item">
      <a href="#">
        <span class="ranking">8</span>
        <div class="content">
          一花一世界明媚春天杜鹃花开满枝头色彩艳丽繁花似锦
        </div>
        <i class="icon"></i>
      </a>
    </li>
    <li class="item">
      <a href="#">
        <span class="ranking">9</span>
        <div class="content">
          一花一世界明媚春天杜鹃花开满枝头色彩艳丽繁花似锦
        </div>
        <i class="icon hot"></i>
      </a>
    </li>
  </ul>

</body>
</html>